<?php

namespace app\beautiful\model\logs;

use app\beautiful\model\member\MemberCouponModel;

use app\beautiful\model\member\MemberModel;

use app\common\model\CommonModel;



class MemberCouponLogsModel extends CommonModel{

    protected  $name = 'beautiful_member_coupon_logs';

    protected  $pk   = 'member_coupon_logs_id';



    public function membercoupon()

    {

        return $this->hasOne(MemberCouponModel::class,'member_coupon_id','member_coupon_id');

    }



    public function member()

    {

        return $this->hasOne(MemberModel::class,'member_id','member_id');

    }



    public function getOperateHiddenMobileAttr($value,$data)

    {

        return $data['operate_mobile'] ? yc_phone($data['operate_mobile']) : '';

    }



}

